package edu.whut.andrecorder;

import java.math.BigInteger;
import java.security.MessageDigest;

public class AndrecorderEncyrpt
{
	//MD5 方法
	public String Md5It(String toEncrptStr)
	{
		try
		{
			MessageDigest md5er=MessageDigest.getInstance("MD5");
			byte[] resB=md5er.digest(toEncrptStr.getBytes("utf-8"));
			String resultStr=new BigInteger(1, resB).toString(16);
			return resultStr;
		}
		catch (Exception e) {
			// handle exception
			return null;
		}
	}
}
